package org.iryshka.skyserver;

import java.io.File;

public class FileHelper {

	public static long getSpaceRecursive(File path) {
		if (path == null)
			return 0;
		if (path.isFile())
			return path.length();
		if (!path.isDirectory())
			return 0;

		File[] filesInPath = path.listFiles();
		long size = 0;
		for (File file : filesInPath) {
			size += getSpaceRecursive(file);
		}
		return size;
	}
}
